<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Profiling</title>


<script type="text/javascript" src="../Profiler.js"></script>

<script type="text/javascript">


var makeGetterProperty = function (name) {  
	var func = function () {
        //var a1 = arguments.callee.caller;
        //var a2 = arguments.callee.caller.caller;
        //var a3 = arguments.callee.caller.caller.caller;
        
        //var a4 = arguments.callee.caller;
        //var a5 = arguments.callee.caller.caller;
        //var a6 = arguments.callee.caller.caller.caller;
        
        return this[arguments.callee.__prop_name__]  
	}  
	
	func.__prop_name__ = name;  
	return func  
}  
  
  
  
var makeGetterClosure = function (name) {  
	return function () {
	   //var a1 = arguments.callee;
	   var a2 = this.stub;
	   return this[name]  
	}  
}  

var getterProp = makeGetterProperty('test');
var getterClosure = makeGetterClosure('test');

var testObj = {
    test : 'test',
    stub : {
        test : 'test'
    }
}

new Profiler(function () {
        getterProp.call(testObj);    
}, "Getter with property attached").run(100000).report();


new Profiler(function () {
        getterClosure.call(testObj);
}, "Getter via closure").run(100000).report();

</script>

</head>

<body>



</body>
</html>